/***************************************
 2010-4-24
 ****************************************/
package com.happy.services;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.core.orm.hibernate.HibernateDao;
import com.core.orm.hibernate.Page;
import com.happy.entity.Resource;
import com.happy.exception.ServicesException;

@Service
@Transactional
public class ResourceServices {
	/** 默认无参构造函数 **/
	public ResourceServices() {
	} 

	private HibernateDao<Resource, Long> resourceDao;

	@Autowired
	public void setSessionFactory(SessionFactory sessionFactory) {
		resourceDao = new HibernateDao<Resource, Long>(sessionFactory,
				Resource.class);
	}

	public Page<Resource> getPage(Page<Resource> page) throws ServicesException {

		// return resourceDao.findPage(page, "");
		return resourceDao.findPage(page,"from Resource");
		
	}
}
